if the short id of this cd = the short id of first cd of this bg then
set icon of bg btn "Prev" to "angleleft.black Off"
set icon of bg btn "Next" to "angleright.black"
set autohilite of bg btn "Prev" to false
set autohilite of bg btn "Next" to true
else
if the short id of this cd = the short id of last cd of this bg then
set icon of bg btn "Next" to "angleright.black Off"
set icon of bg btn "Prev" to "angleleft.black"
set autohilite of bg btn "Next" to false
set autohilite of bg btn "Prev" to true
else
set icon of bg btn "Next" to "angleright.black"
set icon of bg btn "Prev" to "angleleft.black"
set autohilite of bg btn "Next" to true
set autohilite of bg btn "Prev" to true
end if
end if
-- Set up the Xref and Illustration buttons
if bg fld "xrefList" is empty then
set icon of bg button "Help" to "XRef Off"
else
set icon of bg button "Help" to "XRef"
end if
if bg fld "menuList" is empty then
set icon of bg button "Illustration" to "Illustration Off"
else
set icon of bg button "Illustration" to "Illustration"
end if
end openCard
on closeCard
hide bg fld "Xreflist"
hide bg fld "menulist"
hide bg button "bMask"
set hilite of bg btn "Help" to false
set hilite of bg btn "Illustration" to false
lockUnlock "lock"
set scroll of bkgnd field "Text" to 0
pop card into backfrom
push card
end closeCard
on lockUnlock what
global theSavedText
if theSavedText is not empty AND bkgnd field "text" is not theSavedText then
answer "Save changes to this Note?" with "Yes" or "No" or "Cancel"
if it is "Cancel" then exit lockUnlock
else
if it is "No" then put theSavedText into bkgnd field "text"
end if
end if
if what is "lock" OR the icon of bkgnd btn "lockUnlock" is 105 then
set the locktext of bkgnd field "text" to true
set the icon of bkgnd btn "lockUnlock" to "locked"
put empty into theSavedText
else
set the locktext of bkgnd field "text" to false
set the icon of bkgnd btn "lockUnlock" to "unlocked"
put bkgnd field "text" into theSavedText
end if
end lockUnlock
-------------------
-- xref handler
-------------------
-- for use with SpInside Macintosh and Q & A Stack
-- passed a chapter abbreviation, it finds the chapter
-- number with chaptonum() then the chapter location with
-- findchapter or passed the Q & A Stack Name
-- it goes to the Q & A Stack
on xref which
global SpInsideMacName, QAStackName, homeTo,SMKRSflag
if SpInsideMacName is empty then setupxrefname
if QAStackName is empty then setupQAname
lock screen
set lockmessages to true
if which is empty then exit xref
put hometo into savehometo
put (long id of this card) & return before homeTo
push card
set cursor to busy
--
if which = "Q & A Stack" then
go stack QAstackname
if line 1 of the script of this stack contains "Q & A Stack" then
set lockmessages to false
findQA
unlock screen with iris open
exit to HyperCard
else
answer "CanΓÇÖt find ΓÇ£Q & A StackΓÇ¥"
pop card
put savehometo into hometo
set lockmessages to false
unlock screen
exit xref
end if
else
--
go stack SpInsideMacName
--
if line 1 of the script of this stack contains "SpInside Macintosh" then
get findChapter(string2index(which))
if it is not empty then
set lockMessages to false
go card it
checkKRS -- set up KRS if it is there
if SMKRSflag = "true" then push line 1 of homeTo
unlock screen with iris open
exit to HyperCard
else
answer "Can't find referenced chapter" with "OK"
pop card
put savehometo into hometo
set lockmessages to false
unlock screen
exit to HyperCard
end if
else
answer "CanΓÇÖt find ΓÇ£SpInside MacintoshΓÇ¥"
pop card
put savehometo into hometo
set lockmessages to false
unlock screen
exit xref
end if
end if -- Q & A or SpInside Mac?
set lockmessages to false
unlock screen
end xref
-----------------
-- displayPict handler
-----------------
on displayPict
global pictPath,thePict,pictresult
if pictPath is empty then getPath
put pictPath & thePict into whom
TNPict whom,1,0
if the result contains "Error" then
put the result into pictresult
delete word 1 of pictresult
respondpolitely
end if
end displayPict
-----------------
-- getPath handler
-----------------
on getPath
global pictPath
get the long name of this stack
delete char 1 to 7 of it
repeat until last char of it is ":"
delete last char of it
end repeat
put "Tech Note PICTs:" after it
put it into pictPath
end getPath
-----------------
-- respondPolitely handler
-----------------
on respondPolitely
global thePict,pictresult
if pictresult contains "found" then
put "File not found: " & thePict & return & return & "It must be in a folder named ΓÇ£Tech Note PICTs,ΓÇ¥ " & "which must be at the same level as this stack." into errmsg
else
if pictresult contains "memory" then
put "Not enough memory to open file:" & return & return & thePict into errmsg
else
if pictresult contains "operation" then
put "User canceled operation" into errmsg
else
put thePict &" could not be opened" into errmsg
end if
end if
end if
get dialog(errmsg,"OK",1,Chicago,Plain,12)
end respondPolitely
-------------------
-- arrowKey handler for Main bg
-------------------
on arrowKey key
if key is "right" then
send goNext to bg btn "Next"
else if key is "left" then
send goPrev to bg btn "Prev"
else if key is "up" then
if the optionKey is "down" then
pass arrowKey
exit arrowKey
else
click at 498,58
end if
else if key is "down" then
if the optionKey is "down" then
pass arrowKey
exit arrowKey
else
click at 498,305
end if
end if
end arrowKey
-- part 53 (button)
-- low flags: 00
-- high flags: 0002
-- rect: left=3 top=52 right=312 bottom=508
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Mask
-- part 44 (button)
-- low flags: 00
-- high flags: 0002
-- rect: left=3 top=22 right=47 bottom=508
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: mask
-- part 52 (button)
-- low flags: 00
-- high flags: 0002
-- rect: left=5 top=24 right=45 bottom=506
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Mask
-- part 9 (field)
-- low flags: 01
-- high flags: 0007
-- rect: left=5 top=54 right=310 bottom=506
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 22
-- text size: 10
-- style flags: 0
-- line height: 13
-- part name: Text
-- part 2 (field)
-- low flags: 01
-- high flags: 0000
-- rect: left=5 top=24 right=45 bottom=50
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 2
-- text size: 12
-- style flags: 8448
-- line height: 20
-- part name: Number
-- part 7 (field)
-- low flags: 01
-- high flags: 0000
-- rect: left=49 top=24 right=45 bottom=480
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 2
-- text size: 12
-- style flags: 8448
-- line height: 20
-- part name: Title
-- part 28 (button)
-- low flags: 00
-- high flags: 2004
-- rect: left=257 top=316 right=341 bottom=282
-- title width / last selected line: 0
-- icon id / first selected line: 113 / 113
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Next
----- HyperTalk script -----
on mouseDown
goNext
repeat while the mouse is down AND the mouseLoc is within rect of me
goNext
end repeat
end mouseDown
-----------------
-- goNext handler for Main Bg
-----------------
on goNext
if the optionKey is "down" then
if the number of this cd < the number of last cd of this bg then
put the long id of this card into backfrom -- push it later
put bg fld "number" into cardNum
if the number of chars in cardNum > 3 then
delete char 4 of cardNum
if cardNum Γëá char 1 to 3 of bg fld "number" of next card then
visual effect wipe left
go next card
else
set cursor to busy
set lockmessages to true
lock screen
--
repeat until cardNum is not in bg fld "number" of next card
go next card
end repeat
--
set lockmessages to false
go next card
push backfrom
unlock screen with visual effect wipe left
end if
else
visual effect wipe left
go next card
end if
else
visual effect wipe left
go next card
end if
else -- no option key down
if the number of this card < the number of last card of this bg then
visual effect wipe left
go next card
end if
end if
end goNext
-- part 29 (button)
-- low flags: 00
-- high flags: 2004
-- rect: left=228 top=316 right=341 bottom=253
-- title width / last selected line: 0
-- icon id / first selected line: 111 / 111
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Prev
----- HyperTalk script -----
on mouseDown
goPrev
repeat while the mouse is down AND the mouseLoc is within rect of me
goPrev
end repeat
end mouseDown
-----------------
-- goPrev handler for Main Bg
-----------------
on goPrev
if the optionKey is "down" then
if the number of this card > the number of first card of this bg then
put the long id of this card into backfrom -- push it later
put bg fld "number" into cardNum
set lockmessages to true
lock screen
if the number of chars in cardNum > 3 then
delete char 4 of cardNum
if cardNum = char 1 to 3 of bg fld "number" of prev card then
unlock screen
set cursor to busy -- purely cosmetic
lock screen
repeat until cardNum is not in bg fld "number" of prev card
go prev card
end repeat
end if
end if
-- now at first cd of this chap
if the number of chars in bg fld "number" of prev card > 3 then
go prev card
put char 1 to 3 of bg fld "number" into cardNum
repeat until char 4 of bg fld "number" = "b" -- second card
go prev card
end repeat
end if
--
set lockmessages to false
go previous card
push backfrom
unlock screen with visual effect wipe right
else
visual effect wipe right
go prev card
end if
else -- no option key down
if the number of this card > the number of first card of this bg then
visual effect wipe right
go prev card
end if
end if
end goPrev
-- part 80 (button)
-- low flags: 00
-- high flags: 0000
-- rect: left=490 top=28 right=40 bottom=502
-- title width / last selected line: 0
-- icon id / first selected line: 104 / 104
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: lockUnlock
----- HyperTalk script -----
on mouseUp
lockUnlock
end mouseUp
-- part 87 (button)
-- low flags: 00
-- high flags: 2004
-- rect: left=3 top=316 right=341 bottom=39
-- title width / last selected line: 0
-- icon id / first selected line: 106 / 106
-- text alignment: 1
-- font id: 3
-- text size: 9
-- style flags: 0
-- line height: 12
-- part name: Home
----- HyperTalk script -----
on mouseUp
gohome
end mouseUp
-----------------
-- gohome handler
-----------------
--
-- gohome uses a stack structure
--
on gohome
global homeTo, nav_path, navpath
lock screen
--
if the optionKey is "down" then
set icon of bg btn "Home" to "Home"
go Home
exit gohome
end if
--
-- If from NavStack on CD
--
if navpath = "true" then
--
put (item 1 of the clickLoc) - (item 1 of the Loc of bg btn "Home") into E
--
-- Go to Feedback Stack
--
if E < 0 then
push card
put the long name of stack "Home" into NewName
delete char 1 to 7 of NewName
repeat
if not(NewName contains ":") then
exit repeat
else
put char 1 to offset(":",NewName) of NewName after NewPath
delete char 1 to offset(":",NewName) of NewName
end if
end repeat
put NewPath & "P&D Feedback" into feedPath
set cursor to busy
visual effect dissolve fast
go stack feedPath
else
--
-- Return to NavStack if launched from there
--
if E > 0 then
visual effect iris close to black
visual effect iris open
get line 1 of homeTo
delete line 1 of homeTo
delete line 1 of nav_path
--
go it -- former line 1 of homeTo
end if
end if
else
--
-- Normal operation below
--
repeat
get line 1 of homeTo
delete line 1 of homeTo -- pop stack
if it is empty then
exit repeat
else
visual effect iris close
go it
exit gohome
end if
end repeat
visual effect iris close
go Home
end if
end gohome
-- part 88 (button)
-- low flags: 00
-- high flags: 2004
-- rect: left=474 top=316 right=341 bottom=510
-- title width / last selected line: 0
-- icon id / first selected line: 7417 / 7417
-- text alignment: 1
-- font id: 3
-- text size: 9
-- style flags: 0
-- line height: 12
-- part name: Back
----- HyperTalk script -----
on mouseUp
goBack
end mouseUp
-- part 91 (button)
-- low flags: 00
-- high flags: 2004
-- rect: left=55 top=316 right=341 bottom=91
-- title width / last selected line: 0
-- icon id / first selected line: 115 / 115
-- text alignment: 1
-- font id: 3
-- text size: 9
-- style flags: 0
-- line height: 12
-- part name: Number
----- HyperTalk script -----
on mouseUp
lock screen
set cursor to busy
go card id 23921 -- NumberListing
unlock screen with iris close
end mouseUp
-- part 92 (button)
-- low flags: 00
-- high flags: 2004
-- rect: left=137 top=316 right=341 bottom=173
-- title width / last selected line: 0
-- icon id / first selected line: 119 / 119
-- text alignment: 1
-- font id: 3
-- text size: 9
-- style flags: 0
-- line height: 12
-- part name: Subject
----- HyperTalk script -----
on mouseUp
lock screen
set cursor to busy
go card id 22110 -- Subject Listing
unlock screen with iris close
end mouseUp
-- part 93 (button)
-- low flags: 00
-- high flags: 2004
-- rect: left=178 top=316 right=341 bottom=214
-- title width / last selected line: 0
-- icon id / first selected line: 121 / 121
-- text alignment: 1
-- font id: 3
-- text size: 9
-- style flags: 0
-- line height: 12
-- part name: Index
----- HyperTalk script -----
on mouseUp
lock screen
set cursor to busy
go card id 63924 -- IndexListing
unlock screen with iris close
end mouseUp
-- part 96 (button)
-- low flags: 00
-- high flags: 2004
-- rect: left=444 top=316 right=341 bottom=469
-- title width / last selected line: 0
-- icon id / first selected line: 131 / 131
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Print
----- HyperTalk script -----
on mouseUp
goPrintIt
end mouseUp
-- part 97 (button)
-- low flags: 00
-- high flags: 2004
-- rect: left=384 top=316 right=341 bottom=409
-- title width / last selected line: 0
-- icon id / first selected line: 129 / 129
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Find
----- HyperTalk script -----
on mouseUp
global findText
if the selection is not empty then
put the selection into findText
select empty
end if
doMenu "Find..."
end mouseUp
-- part 101 (button)
-- low flags: 00
-- high flags: 2004
-- rect: left=354 top=316 right=341 bottom=379
-- title width / last selected line: 0
-- icon id / first selected line: 130 / 130
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: GoNote
----- HyperTalk script -----
on mouseUp
goNote
end mouseUp
-- part 109 (button)
-- low flags: 00
-- high flags: 2004
-- rect: left=414 top=316 right=341 bottom=439
-- title width / last selected line: 0
-- icon id / first selected line: 127 / 127
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Disk
----- HyperTalk script -----
on mouseUp
goSaveIt
end mouseUp
-- part 114 (button)
-- low flags: 00
-- high flags: 2004
-- rect: left=96 top=316 right=341 bottom=132
-- title width / last selected line: 0
-- icon id / first selected line: 117 / 117
-- text alignment: 1
-- font id: 3
-- text size: 9
-- style flags: 0
-- line height: 12
-- part name: Date
----- HyperTalk script -----
on mouseUp
lock screen
set cursor to busy
go card id 76061 -- DateListing/Contents Listing
unlock screen with iris close
end mouseUp
-- part 112 (button)
-- low flags: 80
-- high flags: 0000
-- rect: left=0 top=0 right=342 bottom=512
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: bMask
----- HyperTalk script -----
on mouseUp
hide bg field "xrefList"
hide bg field "menuList"
set hilite of bg button "Help" to false
set hilite of bg button "Illustration" to false
hide bg button "bMask"
end mouseUp
-- part 95 (button)
-- low flags: 00
-- high flags: 0004
-- rect: left=324 top=316 right=341 bottom=349
-- title width / last selected line: 0
-- icon id / first selected line: 126 / 126
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Illustration
----- HyperTalk script -----
on mouseUp
if bg fld "menuList" is empty then
hide bg btn "bMask"
exit mouseUp
end if
--
set cursor to busy
if visible of bg field "xreflist" is true then
exit mouseUp
else
if visible of bg field "menulist" is true then
hide bg field "menulist"
set hilite of me to false
hide bg button "bMask"
else
show bg button "bMask"
put 0 into mwidth
put the number of lines in bg fld "menuList" into figures
if figures > 0 then
set the style of bg fld "menuList" to rectangle
if figures = 1 then
put 322 into menutop
else
if figures = 2 then
put 306 into menutop
else
if figures = 3 then
put 290 into menutop
else
if figures = 4 then
put 274 into menutop
else
if figures = 5 then
put 258 into menutop
else
if figures = 6 then
put 242 into menutop
else
if figures = 7 then
put 226 into menutop
else
if figures = 8 then
put 210 into menutop
else
if figures = 9 then
put 194 into menutop
else
if figures = 10 then
put 178 into menutop
else
put 178 into menutop
put 16 into mwidth
set the style of bg fld "menuList" to scrolling
set the scroll of bg fld "menuList" to 0
end if -- 10
end if -- 9
end if -- 8
end if -- 7
end if -- 6
end if -- 5
end if -- 4
end if -- 3
end if -- 2
end if -- 1
set the rect of bg fld "menulist" to 348,menutop,418 + mwidth,341
set hilite of bg button "Illustration" to true
show bg field "menuList"
end if -- > 0
end if -- menulist active
end if -- xref active
end mouseUp
-- part 108 (button)
-- low flags: 00
-- high flags: 0004
-- rect: left=294 top=316 right=341 bottom=319
-- title width / last selected line: 0
-- icon id / first selected line: 124 / 124
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Help
----- HyperTalk script -----
on mouseUp
if bg fld "xrefList" is empty then
hide bg btn "bMask"
exit mouseUp
end if
--
set cursor to busy
if visible of bg field "menulist" is true then
exit mouseUp
else
if visible of bg field "xreflist" is true then
hide bg field "xreflist"
set hilite of me to false
hide bg button "bMask"
else
show bg button "bMask"
put 322 into menutop
put the number of lines in bg fld "xrefList" into xrefs
-- get the longest width for menuwidth
put 0 into longstr
repeat with j = 1 to xrefs
if (stringwidth(line j of bg fld "xrefList")) > longstr then
put stringwidth(line j of bg fld "xrefList") into longstr
else
next repeat
end if
end repeat
put 328 + longstr into menuwidth -- start + 1 char + longest str
--
if xrefs > 0 then
set the style of bg fld "xrefList" to rectangle
if xrefs = 1 then
put 322 into menutop
else
if xrefs = 2 then
put 306 into menutop
else
if xrefs = 3 then
put 290 into menutop
else
if xrefs = 4 then
put 274 into menutop
else
if xrefs = 5 then
put 258 into menutop
else
if xrefs = 6 then
put 242 into menutop
else
if xrefs = 7 then
put 226 into menutop
else
if xrefs = 8 then
put 210 into menutop
else
if xrefs = 9 then
put 194 into menutop
else
if xrefs = 10 then
put 178 into menutop
else
put 178 into menutop
set the style of bg fld "xrefList" to scrolling
set the scroll of bg fld "xrefList" to 0
add 20 to menuwidth
end if -- 10
end if -- 9
end if -- 8
end if -- 7
end if -- 6
end if -- 5
end if -- 4
end if -- 3
end if -- 2
end if -- 1
set the rect of bg fld "xreflist" to 318,menutop,menuwidth,341
set hilite of bg button "Help" to true
show bg field "xrefList"
end if -- > 0
end if -- xref active
end if -- illustrations active
end mouseUp
-- part 99 (field)
-- low flags: 81
-- high flags: 0002
-- rect: left=348 top=322 right=341 bottom=418
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: menuList
----- HyperTalk script -----
on mouseUp
global thePict
if the style of bg fld "menuList" = "rectangle" then
put lineClicked(5) into lineClicked
else
put scrollLineClicked(5) into lineClicked
end if
selectlinexcmd the name of me,lineClicked
put "Tech Note" && char 1 to 3 of bg field "Number" && "- Figure" && lineClicked into thePict
hide bg field "menuList"
set hilite of bg button "Illustration" to false
hide bg button "bMask"
displayPict thePict
end mouseUp
-- part 113 (field)
-- low flags: 81
-- high flags: 0002
-- rect: left=318 top=290 right=341 bottom=453
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: xrefList
----- HyperTalk script -----
on mouseUp
global theXRef
if the style of bg fld "xrefList" = "rectangle" then